package com.mms.dbacess;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Scanner;

public class DeleteUser {
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		Scanner Changeusername =new Scanner(System.in);
		System.out.println("��������ɾ���û�������");
		String usernameC=Changeusername.next();
		
		String sql="DELETE FROM `user` WHERE username=?";
		Class.forName("com.mysql.cj.jdbc.Driver");
		
		Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/grtsmms", "root", "root");
		PreparedStatement stme=conn.prepareStatement(sql);
		stme.setString(1, usernameC);
		int re =stme.executeUpdate();
		System.out.println(re);
	}
}
